Optimal. Leaf size=103 \[ \frac {b^2 \left (3 a^2-b^2\right ) \tan (c+d x)}{d}-\frac {4 a b \left (a^2-b^2\right ) \log (\cos (c+d x))}{d}+x \left (a^4-6 a^2 b^2+b^4\right )+\frac {b (a+b \tan (c+d x))^3}{3 d}+\frac {a b (a+b \tan (c+d x))^2}{d} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.11, antiderivative size = 103, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 4, integrand size = 12, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.333, Rules used = {3482, 3528, 3525, 3475} \[ \frac {b^2 \left (3 a^2-b^2\right ) \tan (c+d x)}{d}-\frac {4 a b \left (a^2-b^2\right ) \log (\cos (c+d x))}{d}+x \left (-6 a^2 b^2+a^4+b^4\right )+\frac {b (a+b \tan (c+d x))^3}{3 d}+\frac {a b (a+b \tan (c+d x))^2}{d} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3475
Rule 3482
Rule 3525
Rule 3528
Rubi steps
\begin {align*} \int (a+b \tan (c+d x))^4 \, dx &=\frac {b (a+b \tan (c+d x))^3}{3 d}+\int (a+b \tan (c+d x))^2 \left (a^2-b^2+2 a b \tan (c+d x)\right ) \, dx\\ &=\frac {a b (a+b \tan (c+d x))^2}{d}+\frac {b (a+b \tan (c+d x))^3}{3 d}+\int (a+b \tan (c+d x)) \left (a \left (a^2-3 b^2\right )+b \left (3 a^2-b^2\right ) \tan (c+d x)\right ) \, dx\\ &=\left (a^4-6 a^2 b^2+b^4\right ) x+\frac {b^2 \left (3 a^2-b^2\right ) \tan (c+d x)}{d}+\frac {a b (a+b \tan (c+d x))^2}{d}+\frac {b (a+b \tan (c+d x))^3}{3 d}+\left (4 a b \left (a^2-b^2\right )\right ) \int \tan (c+d x) \, dx\\ &=\left (a^4-6 a^2 b^2+b^4\right ) x-\frac {4 a b \left (a^2-b^2\right ) \log (\cos (c+d x))}{d}+\frac {b^2 \left (3 a^2-b^2\right ) \tan (c+d x)}{d}+\frac {a b (a+b \tan (c+d x))^2}{d}+\frac {b (a+b \tan (c+d x))^3}{3 d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [C] time = 0.37, size = 105, normalized size = 1.02 \[ \frac {-6 b^2 \left (b^2-6 a^2\right ) \tan (c+d x)+12 a b^3 \tan ^2(c+d x)+3 i (a-i b)^4 \log (\tan (c+d x)+i)-3 i (a+i b)^4 \log (-\tan (c+d x)+i)+2 b^4 \tan ^3(c+d x)}{6 d} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.43, size = 100, normalized size = 0.97 \[ \frac {b^{4} \tan \left (d x + c\right )^{3} + 6 \, a b^{3} \tan \left (d x + c\right )^{2} + 3 \, {\left (a^{4} - 6 \, a^{2} b^{2} + b^{4}\right )} d x - 6 \, {\left (a^{3} b - a b^{3}\right )} \log \left (\frac {1}{\tan \left (d x + c\right )^{2} + 1}\right ) + 3 \, {\left (6 \, a^{2} b^{2} - b^{4}\right )} \tan \left (d x + c\right )}{3 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [B] time = 3.33, size = 1071, normalized size = 10.40 \[ \text {result too large to display} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.02, size = 152, normalized size = 1.48 \[ \frac {b^{4} \left (\tan ^{3}\left (d x +c \right )\right )}{3 d}+\frac {2 a \,b^{3} \left (\tan ^{2}\left (d x +c \right )\right )}{d}+\frac {6 a^{2} b^{2} \tan \left (d x +c \right )}{d}-\frac {b^{4} \tan \left (d x +c \right )}{d}+\frac {2 \ln \left (1+\tan ^{2}\left (d x +c \right )\right ) a^{3} b}{d}-\frac {2 \ln \left (1+\tan ^{2}\left (d x +c \right )\right ) a \,b^{3}}{d}+\frac {\arctan \left (\tan \left (d x +c \right )\right ) a^{4}}{d}-\frac {6 \arctan \left (\tan \left (d x +c \right )\right ) a^{2} b^{2}}{d}+\frac {\arctan \left (\tan \left (d x +c \right )\right ) b^{4}}{d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [A] time = 0.76, size = 113, normalized size = 1.10 \[ a^{4} x - \frac {6 \, {\left (d x + c - \tan \left (d x + c\right )\right )} a^{2} b^{2}}{d} + \frac {{\left (\tan \left (d x + c\right )^{3} + 3 \, d x + 3 \, c - 3 \, \tan \left (d x + c\right )\right )} b^{4}}{3 \, d} - \frac {2 \, a b^{3} {\left (\frac {1}{\sin \left (d x + c\right )^{2} - 1} - \log \left (\sin \left (d x + c\right )^{2} - 1\right )\right )}}{d} + \frac {4 \, a^{3} b \log \left (\sec \left (d x + c\right )\right )}{d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 3.89, size = 167, normalized size = 1.62 \[ \frac {b^4\,{\mathrm {tan}\left (c+d\,x\right )}^3}{3\,d}-\frac {\mathrm {tan}\left (c+d\,x\right )\,\left (b^4-6\,a^2\,b^2\right )}{d}-\frac {\ln \left ({\mathrm {tan}\left (c+d\,x\right )}^2+1\right )\,\left (2\,a\,b^3-2\,a^3\,b\right )}{d}+\frac {\mathrm {atan}\left (\frac {\mathrm {tan}\left (c+d\,x\right )\,\left (-a^2+2\,a\,b+b^2\right )\,\left (a^2+2\,a\,b-b^2\right )}{a^4-6\,a^2\,b^2+b^4}\right )\,\left (-a^2+2\,a\,b+b^2\right )\,\left (a^2+2\,a\,b-b^2\right )}{d}+\frac {2\,a\,b^3\,{\mathrm {tan}\left (c+d\,x\right )}^2}{d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [A] time = 0.39, size = 131, normalized size = 1.27 \[ \begin {cases} a^{4} x + \frac {2 a^{3} b \log {\left (\tan ^{2}{\left (c + d x \right )} + 1 \right )}}{d} - 6 a^{2} b^{2} x + \frac {6 a^{2} b^{2} \tan {\left (c + d x \right )}}{d} - \frac {2 a b^{3} \log {\left (\tan ^{2}{\left (c + d x \right )} + 1 \right )}}{d} + \frac {2 a b^{3} \tan ^{2}{\left (c + d x \right )}}{d} + b^{4} x + \frac {b^{4} \tan ^{3}{\left (c + d x \right )}}{3 d} - \frac {b^{4} \tan {\left (c + d x \right )}}{d} & \text {for}\: d \neq 0 \\x \left (a + b \tan {\relax (c )}\right )^{4} & \text {otherwise} \end {cases} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________